﻿using System;
using CRM.Models.Email;

namespace CRM.ViewModels.Email
{
    public class EmailMarkeingLogVM
    {
        public int Id { get; set; }
        
        public int UserId { get; set; }
        
        public int GroupId { get; set; }
        
        public int CompanyId { get; set; }

        public int OemId { get; set; }

        public int EmailMarketingId { get; set; }

        public TypeEnum Type { get; set; }

        public enum TypeEnum
        {
            Initiative = 1,
            Negative = 2
        }

        public string OperationContent { get; set; }
        
        public string OperateUserName { get; set; }
        
        public EmailMarkeingLog NewModel(Models.User user,int id,EmailMarkeingLog.TypeEnum type,string operationContent)
        {
            var result_model = new EmailMarkeingLog()
            {
                UserId = user.Id,
                OemId = user.OemId,
                CompanyId = user.CompanyId,
                GroupId = user.GroupId,
                EmailMarketingId = id,
                Type = type,
                OperationContent = operationContent,
                OperateUserName = user.UserName,
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now
            };
            return result_model;
        }

        public class EmailMarketingLogQuery
        {
            public int Id { get; set; }
        }
    }
}